package com.iotechn.unimall.app.api.news;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.NewsDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 新闻
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-07-15 20:27:55
 */
@HttpOpenApi(group = "news", description = "新闻")
public interface NewsService{

    @HttpMethod(description = "首页列表")
    List<NewsDO> home(
            @HttpParam(name = "category", type = HttpParamType.COMMON, description = "搜索分类" ,valueDef="1") String categoryId
            ) throws ServiceException;

    @HttpMethod(description = "列表")
    Page<NewsDO> list(
            @HttpParam(name = "category", type = HttpParamType.COMMON, description = "分类",valueDef="1") String categoryId,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "5") Integer limit) throws ServiceException;

    @HttpMethod(description = "详情")
    NewsDO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") String id) throws ServiceException;

    @HttpMethod(description = "banner")
    String roundRobinBanner();

    @HttpMethod(description = "一分田2条")
    List<NewsDO> yifentianList();

}

